//package org.dromara.oce.config;
//
//
//import co.elastic.clients.elasticsearch.ElasticsearchClient;
//import co.elastic.clients.json.jackson.JacksonJsonpMapper;
//import co.elastic.clients.transport.ElasticsearchTransport;
//import co.elastic.clients.transport.rest_client.RestClientTransport;
//import org.apache.http.HttpHost;
//import org.elasticsearch.client.RestClient;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.data.elasticsearch.core.convert.ElasticsearchCustomConversions;
//
//import java.util.List;
//
//@Configuration
//public class ElasticsearchConfig {
//
//    @Bean
//    public ElasticsearchClient elasticsearchClient() {
//        RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200)).build();
//
//        // 配置兼容性
//        ElasticsearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
//
//        return new ElasticsearchClient(transport);
//    }
//    @Bean
//    public ElasticsearchCustomConversions elasticsearchCustomConversions(
//        LongToLocalDateTimeConverter longToLocalDateTimeConverter) {
//        return new ElasticsearchCustomConversions(List.of(longToLocalDateTimeConverter));
//    }
//
//
//
//}
